<div>
    <h2>
        <span jhiTranslate="personApp.department.home.title">Departments</span>
        <button class="btn btn-primary float-right jh-create-entity create-department-person" [routerLink]="['/', { outlets: { popup: ['department-person-new'] } }]">
            <span class="fa fa-plus"></span>
            <span  jhiTranslate="personApp.department.home.createLabel">
            Create new Department
            </span>
        </button>
    </h2>
    <jhi-alert></jhi-alert>
    <div class="row">
    </div>
    <br/>
    <div class="table-responsive" *ngIf="departments">
        <table class="table table-striped">
            <thead>
            <tr jhiSort [(predicate)]="predicate" [(ascending)]="reverse" [callback]="transition.bind(this)">
            <th jhiSortBy="id"><span jhiTranslate="global.field.id">ID</span> <span class="fa fa-sort"></span></th>
            <th jhiSortBy="name"><span jhiTranslate="personApp.department.name">Name</span> <span class="fa fa-sort"></span></th>
            <th jhiSortBy="desc"><span jhiTranslate="personApp.department.desc">Desc</span> <span class="fa fa-sort"></span></th>
            <th></th>
            </tr>
            </thead>
            <tbody>
            <tr *ngFor="let department of departments ;trackBy: trackId">
                <td><a [routerLink]="['../department-person', department.id ]">{{department.id}}</a></td>
                <td>{{department.name}}</td>
                <td>{{department.desc}}</td>
                <td class="text-right">
                    <div class="btn-group flex-btn-group-container">
                        <button type="submit"
                                [routerLink]="['../department-person', department.id ]"
                                class="btn btn-info btn-sm">
                            <span class="fa fa-eye"></span>
                            <span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
                        </button>
                        <button type="submit"
                                [routerLink]="['/', { outlets: { popup: 'department-person/'+ department.id + '/edit'} }]"
                                replaceUrl="true"
                                class="btn btn-primary btn-sm">
                            <span class="fa fa-pencil"></span>
                            <span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
                        </button>
                        <button type="submit"
                                [routerLink]="['/', { outlets: { popup: 'department-person/'+ department.id + '/delete'} }]"
                                replaceUrl="true"
                                class="btn btn-danger btn-sm">
                            <span class="fa fa-remove"></span>
                            <span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
                        </button>
                    </div>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
        <div *ngIf="departments && departments.length">
            <div class="row justify-content-center">
                <jhi-item-count [page]="page" [total]="queryCount" [itemsPerPage]="itemsPerPage"></jhi-item-count>
            </div>
            <div class="row justify-content-center">
                <ngb-pagination [collectionSize]="totalItems" [(page)]="page" (pageChange)="loadPage(page)"></ngb-pagination>
            </div>
        </div>
</div>
